package com.example.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.domain.entity.Product;
import com.example.domain.entity.ProviderComplaint;
import com.example.mapper.ProductMapper;
import com.example.mapper.ProviderComplaintMapper;
import com.example.service.IProductService;
import com.example.service.IProviderComplaint;

public class ProviderComplaintServiceImpl extends ServiceImpl<ProviderComplaintMapper, ProviderComplaint> implements IProviderComplaint {

    @Override
    public ProviderComplaint getLatestByProviderId(Integer providerId) {
        return lambdaQuery()
                .eq(ProviderComplaint::getProviderId, providerId)
                .orderByDesc(ProviderComplaint::getComplaintTime)
                .last("LIMIT 1")
                .one();
    }
}
